package model

import (
	"math"
)

func BinarySearch(List map[int]int,Search int)(mid int,result int,num int){
	low:=0
	high:=len(List)-1
	num=0
	for low<=high{
		num++
		mid:= int(math.Floor(float64((low+high)/2)))
		if List[mid] < Search {
			low = mid+1
		} else if List[mid]> Search{
			high = mid-1
		} else {
			return mid,List[mid],num
		}
	}
	return -1,-1,-1
}